function backDeviceGroupAdd() {
	window.location.href = 'deviceGroup.jsp';

}

function cleanupDevice() {
	$("#remark").attr("value", '')
	$("#dvcGroupName").attr("value", '')
}

function submitData() {
	var a = document.getElementById("dvcGroupName").value.trim();
	var b = document.getElementById("remark").value.trim();
	if(a == "") {
		alert("设备组名称为空！")
	} else {
		var param = {
			companyId: $.Cookie("companyId"),
			userId: $.Cookie("userId"),
			session: $.Cookie("session"),
			operationFlag: 0,
			dvcGroupName: $("#dvcGroupName").val(),
			remark: b
		}
		$.ajax({
			url: 'dvcGroupOperation',
			type: 'POST',
			data: param,
			dataType: 'json',
			success: function(data) {
				if(data.errorCode == '0') {
					window.location.href = 'deviceGroup.jsp';

				} else if(data.errorCode == '-1') {
					alert("系统异常！请重试")
					window.location.href = 'deviceGroupAdd.jsp';

				} else if(data.errorCode == '-6') {
					alert("登陆超时！请重新登录")
					top.location.href = 'index.jsp';
				}

			},
			error: function(err) {
					alert("连接服务器失败！请重新提交！");
					top.location.href = 'index.jsp';
			}
		});

	}

}